/**
 * @file src/datatypes/ScheduleLinear.java
 */
package datatypes;

/**
 * Interface for the simulated annealing scheduler
 */
public class ScheduleLinear implements ISchedule
{
	/** maximal budget of time for task */
	private long mTimeBudget;

	public ScheduleLinear(long timeBudget)
	{
		mTimeBudget = timeBudget;
	}
	
	/**
	 * Evaluation function
	 * 
	 * @param time Current time in milli seconds
	 * 
	 * @return Evaluated value in [0.0f, 1.0f]
	 */
	public float eval(long time)
	{
		/** time already passed the budget ? */
		if (time > mTimeBudget) { return 0.0f; }
		
		/** compute evaluation linear to time */
		return ( 1.0f / (float) mTimeBudget ) * (float) time + 1.0f;
	
	} // eval(long time)
	

} // class ScheduleLinear
